package com.orchidea.uml.manager.command
{
    import com.orchidea.uml.model.document.Document;
    import com.orchidea.uml.model.document.Entity;

    public class LinkEntitiesCommand implements IUndoable
    {

        private var _timestamp : Date;

        private var document : Document;
        private var entity1 : Entity;
        private var entity2 : Entity;

        public function get timestamp( ) : Date { return _timestamp; }
		public function get description( ) : String { return "Add entity"; }


        public function LinkEntitiesCommand(document:Document, entity1:Entity, entity2:Entity)
        {
            this.document = document;
            this.entity1 = entity1;
            this.entity2 = entity2;
        }

        public function execute():void
        {
            if ( _timestamp == null )
            {
				// don't overwrite the timestamp on redo
				_timestamp = new Date();
			}
        }

        public function undo():void
        {
        }

        public function redo():void
        {
            execute();
        }
    }
}